package Chapter6;

//124页程序6.2 方法覆盖
class Point_2D {
    void print() {
        System.out.println("这是父类的方法");
    }
}

class Point_3D extends Point_2D {
    void print() {
        System.out.println("这是子类重写的方法");
    }
}

public class PointTest2 {
    public static void main(String[] args) {
        Point_2D sup_2D = new Point_2D();
        sup_2D.print();

        Point_3D sup_3D = new Point_3D();
        sup_3D.print();
    }
}

